package io.renren.modules.live.service.impl;

import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.live.dao.FanweBankCardDao;
import io.renren.modules.live.entity.FanweBankCardEntity;
import io.renren.modules.live.service.FanweBankCardService;


@Service("fanweBankCardService")
public class FanweBankCardServiceImpl extends ServiceImpl<FanweBankCardDao, FanweBankCardEntity> implements FanweBankCardService {
    @Autowired
    private FanweBankCardDao fanweBankCardDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<FanweBankCardEntity> page = this.page(
                new Query<FanweBankCardEntity>().getPage(params),
                new QueryWrapper<FanweBankCardEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<FanweBankCardEntity> getByUserId(Long id) {
        return fanweBankCardDao.getByUserId(id);
    }

    @Override
    public void deleteByUserId(Long userId, String bankNumber) {
        fanweBankCardDao.deleteByUserId(userId,bankNumber);
    }


}